
#include <iostream>

#include "test.h"

static std::set<std::string> local_init_set() {
    std::set<std::string> tmp;
    tmp.insert("aaaa");
    tmp.insert("bbbb");
    tmp.insert("cccc");
         return tmp;
}

// 此语法必须使用 -std=c++11  进行编译
std::map<std::string, int> test::m_ = {
    std::make_pair("a", 1),
    std::make_pair("b", 2),
    std::make_pair("c", 3),
};

std::set<std::string> test::s_(local_init_set());

test::test() {}

test::~test() {}

void test::size() const {

    std::cout << "map size=" << m_.size() << std::endl;
    std::cout << "set size=" << s_.size() << std::endl;
    std::map<std::string, int>::iterator it = m_.begin();
    for(; it!=m_.end(); ++it) {
        std::cout << "(" << it->first<<"," << it->second << ")" << std::endl;
    }

    std::set<std::string>::iterator sit = s_.begin();
    for(; sit!=s_.end(); ++sit) {
        std::cout << "set value=" << *sit << std::endl;
    }
}

